function isChinese(str) {
    var reg = /[\u4E00-\u9FA5\uF900-\uFA2D]/;
    return reg.test(str);
}

function debounce(func, wait) {
    let timeout = null
    return function () {
        let context = this
        let args = arguments
        if (timeout) clearTimeout(timeout)
        timeout = setTimeout(() => {
            func.apply(context, args)
        }, wait)
    }
}
function throttle(func, wait) {
    let timeout = null
    return function () {
        let context = this
        let args = arguments
        if (!timeout) {
            timeout = setTimeout(() => {
                timeout = null
                func.apply(context, args)
            }, wait)
        }
    }
}
//u4e00-u9fbf:  unicode CJK(中日韩)统一表意字符。u9fa5后至u9fbf为空
//uF900-uFAFF:  unicode CJK 兼容象形文字  。uFA2D后至uFAFF为空

export default {
    isChinese,
    debounce, 
    throttle
}